Ext.define('App.activiti.process.view.ProcessList', {
    extend: 'Ext.panel.Panel',
    alias: 'widget.ProcessList',
    items: [{
        xtype: 'button',
        text: '新建请假工作流',
        handler: function () {
            Ext.Ajax.request({
                url: 'activiti/process/create',
                params: {'processDefinitionKey': 'vacation_process'},
                success: function (resp) {
                    Ext.create('Extend.form.activiti.FormPanel', {
                        url: 'activiti/process/start',
                        formData: resp.result.data.formData,
                        getParams: function () {
                            return {'processDefinitionKey': 'vacation_process'};
                        }
                    }).show();
                }
            });
        }
    }]
});